﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ctrlEntradaDeMercadoria.ascx.cs" Inherits="EstoqueUnifeiADO.Controles.ctrlEntradaDeMercadoria" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="ctrlViewItemEntraMerca.ascx" TagName="ctrlViewItemEntraMerca"
    TagPrefix="uc1" %>
<%@ Register src="ctrlEntradaNota.ascx" tagname="ctrlEntradaNota" tagprefix="uc2" %>
<%@ Register src="ctrlentradaNotaFapep.ascx" tagname="ctrlentradaNotaFapep" tagprefix="uc3" %>
<table>
        <tr>
            <td style="width: 60%; vertical-align: top">
                <asp:ObjectDataSource ID="odsEntraMerca" runat="server" OldValuesParameterFormatString="original_{0}"
                    SelectMethod="GetData" TypeName="EstoqueUnifeiADO.Dados.dsEntradaMercadoriaTableAdapters.ENTRADAMERCADORIATableAdapter">
                </asp:ObjectDataSource>
                <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" BackColor="#B5C7DE"
                    DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284E98"
                    StaticSubMenuIndent="10px" Width="98%" BorderStyle="Solid" 
                    BorderWidth="2px" onmenuitemclick="Menu1_MenuItemClick"
                   >
                    <DynamicHoverStyle BackColor="#284E98" ForeColor="White" />
                    <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                    <DynamicMenuStyle BackColor="#B5C7DE" />
                    <DynamicSelectedStyle BackColor="#507CD1" />
                    <Items>
                        <asp:MenuItem Text="Entrada mercadoria" Value="Entramercadoria" ImageUrl="~/images/Icones/application_form_add.png">
                        </asp:MenuItem>
                        <asp:MenuItem Text="Entrada mercadoria FAPEP" Value="EntradaFAPEP" ImageUrl="~/images/Icones/application_form_add.png">
                        </asp:MenuItem>
                    </Items>
                    <StaticHoverStyle BackColor="#284E98" ForeColor="White" />
                    <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="10px" />
                    <StaticSelectedStyle BackColor="#507CD1" />
                </asp:Menu>
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <asp:GridView ID="gvListEntraMerca" runat="server" AutoGenerateColumns="False" DataKeyNames="CODENTRAMERCA"
                            DataSourceID="odsEntraMerca" CellPadding="4" ForeColor="#333333" GridLines="None"
                            OnSelectedIndexChanged="gvListEntraMerca_SelectedIndexChanged" Width="98%" SkinID="gvTeste">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/Icones/application_form_magnify.png"
                                            ToolTip="Visualizar detalhes" CommandName="Select" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="CODENTRAMERCA" HeaderText="Código" InsertVisible="False"
                                    ReadOnly="True" SortExpression="CODENTRAMERCA" />
                                <asp:BoundField DataField="DATAENTRAMERCA" HeaderText="Data" SortExpression="DATAENTRAMERCA"
                                    DataFormatString="{0:dd/MM/yyyy}" HtmlEncode="False" />
                                <asp:BoundField DataField="NUMERONOTA" HeaderText="Nº da nota" SortExpression="NUMERONOTA" />
                                <asp:BoundField DataField="NUMEROEMPENHO" HeaderText="Nº do empenho" SortExpression="NUMEROEMPENHO" />
                                <asp:BoundField DataField="NUMEROPROCESSO" HeaderText="Nº do processo" SortExpression="NUMEROPROCESSO" />
                                <asp:BoundField DataField="NUMEROAUTORIZACAO" HeaderText="Nº da confirmação" SortExpression="NUMEROAUTORIZACAO" />
                                <asp:CheckBoxField DataField="FAPEP" HeaderText="FAPEP ?" SortExpression="FAPEP" />
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td>
                <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                    <ContentTemplate>
                        <uc1:ctrlViewItemEntraMerca ID="ctrlItemEntrada" runat="server" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="btnDumy" runat="server" Text="Button" Style="display: none" />
                <asp:Button ID="btnDummy2" runat="server" Text="Button" Style="display: none" />
                <asp:ModalPopupExtender ID="modal" runat="server" DynamicServicePath="" Enabled="True"
                    TargetControlID="btnDumy" PopupControlID="pnlEntradaNota" BackgroundCssClass="modalBackground"
                    >
                </asp:ModalPopupExtender>
                <asp:ModalPopupExtender ID="modalFapep" runat="server" DynamicServicePath=""
                    Enabled="True" TargetControlID="btnDumy" PopupControlID="pnlEntradaNotaFapep" BackgroundCssClass="modalBackground"
                    >
                </asp:ModalPopupExtender>
                <asp:Panel ID="pnlEntradaNota" runat="server" Width="710px" BackColor="White">
                <div style="text-align:right">
                    <asp:Button ID="btnCloseEntradaNota" runat="server" Text="X" OnClick="CancelouProcesso"/>
                </div>
                    <uc2:ctrlEntradaNota ID="ctrlEntradaNota1" runat="server" OnCancelarProcesso="CancelouProcesso" 
                    OnProcessarEntradaNota="ProcessarEntradaNota" OnConcluirProcesso="ConcluirProcesso" />
                </asp:Panel>
                <asp:Panel ID="pnlEntradaNotaFapep" runat="server" Width="710" BackColor="White">
                 <div style="text-align:right">
                    <asp:Button ID="btnCloseEntradaNotaFapep" runat="server" Text="X" OnClick="CancelouProcesso"  />
                </div>
                  <uc3:ctrlentradaNotaFapep ID="ctrlentradaNotaFapep1" runat="server" OnCancelarProcesso="CancelouProcesso" 
                   OnProcessarEntradaNota="ProcessarEntradaNota" OnConcluirProcesso="ConcluirProcesso" />
                </asp:Panel>
            </td>
        </tr>
    </table>